package test.n00000;

public class Problem00081 {
    public static void main(String[] args) {
        println(123);
    }

    public static void println(final int x) {
        Solution ss = new Solution();
        System.out.println(x + "," + ss.isPalindrome(x));
    }

    public static class Solution {

        /**
         * 回文数, 顺序和逆序值相等
         *
         * @param x
         * @return
         */
        public boolean isPalindrome(int x) {
            char[] a1 = String.valueOf(x).toCharArray();
            char[] a2 = new char[a1.length];
            for (int i = 0; i < a1.length / 2; i++) {
                a2[i] = a1[a1.length - i - 1];
            }

            for (int i = 0; i < a1.length / 2; i++) {
                if (a1[i] != a2[i]) {
                    return false;
                }
            }
            return true;
        }
    }
}
